
const _w = document.getElementById('app').getBoundingClientRect().width
const _h = document.getElementById('app').getBoundingClientRect().height

export class Align {
  // 设置宽度缩放
  static scaleToGameW (obj, per) {
    obj.displayWidth = _w * per
    obj.scaleY = obj.scaleX
  }

  // 设置居中
  static center (obj) {
    obj.x = _w / 2
    obj.y = _h / 2
  }

  // 设置宽度居中
  static centerW (obj) {
    obj.x = _w / 2
  }

  // 设置高度居中
  static centerH (obj) {
    obj.x = _h / 2
  }
}
